package com.whfc.mach.dao;

import com.whfc.mach.dto.AppMachOilSheetDTO;
import com.whfc.mach.entity.AppMachOilSheet;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AppMachOilSheetMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(AppMachOilSheet record);

    int insertSelective(AppMachOilSheet record);

    AppMachOilSheet selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(AppMachOilSheet record);

    int updateByPrimaryKey(AppMachOilSheet record);

    /**
     * 查询设备油位与容积关系
     *
     * @param machId
     * @return
     */
    List<AppMachOilSheetDTO> selectByMachId(@Param("machId") Integer machId);

    /**
     * 删除设备油位与容积关系
     *
     * @param machId
     * @return
     */
    int deleteByMachId(@Param("machId") Integer machId);

    /**
     * 批量插入设备油位与容积关系
     *
     * @param machId       设备ID
     * @param oilSheetList 对应关系
     * @return
     */
    int batchInsert(@Param("machId") Integer machId, @Param("oilSheetList") List<AppMachOilSheetDTO> oilSheetList);
}